<template>
    <div class="dialog">
        <lb-header :title="'发布'" :backShow="true"></lb-header>
        <input type="text" placeholder="昵称" v-model="obj.nickname">
        <input type="text" placeholder="标题" v-model="obj.title">
        <input type="text" placeholder="内容" v-model="obj.con">
        <button @click="public">发布</button>
    </div>
</template>
<script>
import lbHeader from './lb-header'
export default {
    components:{
        lbHeader
    },
    data(){
        return {
            obj:{
                nickname:'',
                title:'',
                con:''
            }
        }
    },
    methods:{
        public(){
            this.$http.post('/api/add',this.obj).then((res) => {
                if(res.data.code === 1){
                    this.$emit('close');
                }
            }).catch((error) => {
                console.warn(error);
            })
        }
    }

}
</script>

<style lang="scss"> 
    .dialog{
        width: 100%;
        height: 100%;
        position: absolute;
        top:0;
        left:0;
        background: rgba(0,0,0,.8);
    }
</style>


